package com.cskaoyan.controller;

import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.bean.vo.WXSearchIndexVO;
import com.cskaoyan.service.WXSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/wx/search")
public class WXSearchController {
    @Autowired
    WXSearchService wxSearchService;

    @RequestMapping("/index")
    public BaseRespVo index() {
        WXSearchIndexVO index = wxSearchService.index( );
        return BaseRespVo.success(index);
    }

    @RequestMapping("/helper")
    public BaseRespVo helper(String keyword) {
        return BaseRespVo.success( );
    }

    @PostMapping("/clearhistory")
    public BaseRespVo clearhistory() {
        wxSearchService.clearHistory();
        return BaseRespVo.success( );
    }

}
